package cn.zm.app.serviceImpl;

import javax.annotation.Resource;

import org.junit.Test;
import org.springframework.stereotype.Service;

import cn.zm.app.dao.DevUserMapper;
import cn.zm.app.pojo.BackendUser;
import cn.zm.app.pojo.DevUser;
import cn.zm.app.service.DevUserService;

@Service("devUserService")
public class DevUserServiceImpl implements DevUserService {

	@Resource
	private DevUserMapper devUserDao;

	public boolean selectUser(String name, String pass) {
		boolean a = false;
		DevUser du = devUserDao.selectUser(name);
		if (null != du) {
			if (du.getDevPassword().equals(pass)) {
				System.out.println("成功");
				a = true;
			} else {
				System.out.println("失败");
			}
		} else {
			System.out.println("账号不存在");
		}
		return a;
	}

	/*
	 * 查询用户user
	 * @see cn.zm.app.service.DevUserService#selectUser2(java.lang.String, java.lang.String)
	 */
	public DevUser selectUser2(String name, String pass) {		
		DevUser du = devUserDao.selectUser(name);
		return du;
	}

	/*
	 * 查询管理员BackendUser
	 * @see cn.zm.app.service.DevUserService#selectBackend(java.lang.String)
	 */
	public BackendUser selectBackend(String code) {
		BackendUser bu=devUserDao.selectBackend(code);
		return bu;
	}

}
